import Vue from 'vue'
const longArticle = {
    // 发布长文章
    NewsControllersaveLongArticlePath: function NewsControllersaveLongArticlePath(ip, postdata) {
        return Vue.http.post(ip, postdata).then(response => {
            if (response.status === 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },
    // 保存文章到草稿箱
    DraftsControllersaveLongArticleDraftPath: function DraftsControllersaveLongArticleDraftPath(ip, postdata) {
        return Vue.http.post(ip, postdata).then(response => {
            if (response.status === 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },
    // 获取草稿箱列表
    DraftsControllerlistLongArticlePath: function DraftsControllerlistLongArticlePath(ip, postdata) {
        return Vue.http.post(ip, postdata).then(response => {
            if (response.status === 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },
    // 删除草稿
    DraftsControllerdeleteNewsPath: function DraftsControllerdeleteNewsPath(ip, postdata) {
        return Vue.http.post(ip, postdata).then(response => {
            if (response.status === 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },
    // 恢复回收站数据
    DraftsControllerrecoverNewsPath: function DraftsControllerrecoverNewsPath(ip, postdata) {
        return Vue.http.post(ip, postdata).then(response => {
            if (response.status === 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },
}

export default longArticle